﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.ajax({
            url: "../data/system.aspx?method=1509",
            async: false,
            success: function (text) {
                if (text == "no")
                    window.location = "error.html";
                else if (text == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                    var tabs = parent.mini.get("mainTabs");
                    var tab1 = tabs.getTab("tab$log");
                    var tab2 = tabs.getTab("tab$1509");
                    tab2.enabled = true;
                    tabs.removeTab(tab1);
                    tabs.activeTab(tab2);
                }
            }
        });
        var str = window.location.search;
        var arr = str.split("=");
        var suno = arr[1].substr(0, arr[1].indexOf('&'));
    </script>
</head>
<body>
    <div class="mini-toolbar" style="border-bottom: 0;">
        <table>
            <tr>
                <td><div id="suname"></div></td>
                <td>
                    关键字：
                    <input class="mini-textbox" id="key" emptytext="关键字" />
                    类型：
                    <input id="state" class="mini-combobox" style="width: 60px;" data="LogType" value="0"/>
                    <a class="mini-button" iconcls="icon-search" plain="true" onclick="search();">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit" >
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" allowresize="true"
            idfield="id" url="../data/system.aspx?method=GetSyslogList" sizeList="[15,20,50,100]" pageSize="15">
            <div property="columns">
                <div type="indexcolumn"></div>
                <div field="su_login" width="100px" headeralign="center" align="center" allowsort="true">
                    操作人</div>
                <div field="sl_type" width="50px" headeralign="center" align="center" allowsort="true" renderer="onLogTypeRenderer">
                    类型</div>
                <div field="sl_time" width="100px" headeralign="center" align="center" allowsort="true" dateformat="yyyy-MM-dd HH:mm:ss">
                    操作时间</div>
                <div field="sl_ip" width="100px" headeralign="center" align="center" allowsort="true">
                    操作IP</div>
                <div field="sl_memo" width="300px" headeralign="center" align="left" allowsort="true">
                    操作内容</div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            complete: function (XMLHttpRequest, textStatus) {
                // 通过XMLHttpRequest取得响应头，sessionstatus
                var sessionstatus = XMLHttpRequest.getResponseHeader("sessionstatus");
                if (XMLHttpRequest.responseText == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                }
            }
        });
        mini.parse();

        $.ajax({
            url: "../data/system.aspx?method=GetUserName",
            async: false,
            data: { id: suno },
            success: function (text) {
                $("#suname").html("用户：<font color='Blue'>" + text + "</font>");
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                ShowMessage("系统提示", "页面加载失败！", 3);
            }
        });

        var grid = mini.get("datagrid1");
        search();

        function search() {
            var state = mini.get("state").getValue();
            var key = mini.get("key").getValue();
            grid.load({ suno: suno, state: state, key: key });
            grid.sortBy("sl_no", "desc");
        }

        function CloseWindow(action) {
            window.CloseOwnerWindow("ok");
            var tabs = parent.mini.get("mainTabs");
            var tab = tabs.getTab("tab$1509");
            tab.enabled = true;
            var iframe = tabs.getTabIFrameEl(tab);
            iframe.contentWindow.search();
            tabs.activeTab(tab);
        }
    </script>
</body>
</html>